<template>
  <div class="bookCommentListItem">
    <div>
      <span>{{ item.username }}</span>
      <span>{{ formatTime(item.commentDate) }}</span>
    </div>
    <div>{{ item.content }}</div>
  </div>
</template>

<script setup lang="ts">
import { formatTime } from '@/utils/util.js'
interface commit {
  id: number
  content: string
  commentDate: string
  username: string
  book: null
}
withDefaults(
  defineProps<{
    item: commit
  }>(),
  {
    item: () => ({
      id: 2,
      content: '你好啊',
      commentDate: '2023-12-31',
      username: 'zzd',
      book: null,
    }),
  }
)
</script>

<style scoped>
.bookCommentListItem {
  border-bottom: solid 1px #ccc;
  margin-bottom: 10px;
}
.bookCommentListItem span {
  margin-right: 20px;
}
</style>
